<?php
	include('public/bootrap.php');
	
	$counter = $db->fetchOne("SELECT * FROM tblwebinfo WHERE type ='counter'");
	
	$cookie = $_COOKIE['counter'];
	
	if($cookie=='yes'){
	
	}else{
		$tid = 36288000;
		$flag = false;
		if($counter['content']){
			$count = $counter['content'];
			$flag = true;
		}else{
			$count = 0;
		}
		$count++; 
		if($flag){
			$data = array('content'=>$count);
			$db->update('tblwebinfo', $data, ' type ="counter" ');
		}else{
			$data = array('content'=>$count,
						  'type'=>'counter');
			$db->insert('tblwebinfo', $data);
		}
		setcookie("counter","yes",time()+$tid); 
	}
	$c			= _POST('c');
	define('ROOT_APP',dirname(__FILE__));
	switch($c){
		case 'login': include('home.php');break;
		default		: include('home.php');break;
	}
	
	